// {
//     "code": 0,
//     "msg": "success",
//     "data": {
//         "id": 0,
//         "username": "admin",
//         "password": "any",
//         "name": "Super Admin",
//         "avatar": "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
//         "introduction": "I am a super administrator",
//         "email": "admin@test.com",
//         "phone": "1234567890",
//         "roles": [
//             "admin"
//         ]
//     }
// }
import { RouteRecordRaw } from 'vue-router'
import { IBaseResponseModel } from './baseResponseModel'

export interface UserInfoModel {
  id: number
  username: string
  password: string
  name: string
  avatar: string
  introduction: string
  email: string
  phone: string
  roles: string[]
}

export interface Users {
  items: any
}

export interface IUserModel {
  username: string
  password: string
  confirmPassword?: string
  code?: string
  uuid?: string
  rememberMe?: boolean
}

/**
 * 验证码model对象
 */
export interface ICodeModel {
  /**
   * 是否启用验证码
   */
  captchaEnabled: boolean
  /**
   * http 请求返回状态码
   */
  code: number
  /**
   * 图片信息,base64编码字符串
   */
  img: string
  /**
   * 提示信息
   */
  msg: string
  uuid: string
}

export interface IUserState {
  token: string
  name: string
  avatar: string
  introduction: string
  roles: string[]
  routers: RouteRecordRaw[]
  email: string
  premission: string[]
}

export interface ILoginResponse extends IBaseResponseModel {
  data: {
    access_token: string
    expires_in: number
  }
}

export interface IUserInfoResponse extends IBaseResponseModel {
  permissions: string[]
  roles: string[]
  user: {
    userId?: number
    deptId?: number
    userName: string
    nickName?: string
    email?: string
    phonenumber?: string
    avatar?: string
    admin?: true
  }
}
